/* 销售-访销单
 */

import { postRequest, getRequest, getDownload, uploadRequest } from '@/lib/axios'

export const orderApi = {
  // 访销单列表
  queryList: (param) => {
    return getRequest('/order/list', param)
  },
  // 访销单新增
  create: (param) => {
    return postRequest('/order/add', param)
  },
  // 访销单编辑
  edit: (param) => {
    return postRequest('/order/edit', param)
  },
  // 访销单修改
  modify: (param) => {
    return postRequest('/order/modify', param)
  },
  // 访销单删除
  delete: (param) => {
    return postRequest('/order/del', param)
  },
  // 访销单 审核
  checkOrder: (param) => {
    return postRequest('/order/check', param)
  },
  // 校验库存
  checkStock: (param) => {
    return postRequest('/order/is_stock_sufficient', param)
  },
  // 下载模版
  downloadExcel: () => {
    return getDownload('/order/template')
  },
  // 导入访销单
  importOrder: (data) => {
    return uploadRequest('/order/import', data)
  }
}
